package com.yuezhu.util;

import android.app.Activity;
import android.content.Intent;

import com.yuezhu.activity.LoginActivity;
import com.yuezhu.been.UserMsg;
import com.yuezhu.constante.BusAction;

import org.greenrobot.eventbus.EventBus;

/**
 * Created by xuxingcan on 2016/7/24.
 */
public class LoginOut {
    public static void LoginOut(final Activity activity) {
        String name = UserMsg.getInstance().getUserName();
        MyToast.showDefaltToast("登录失效，请重新登录！");
        UserMsg.getInstance().quitOut();
        EventBus.getDefault().post(new BusAction.quitApp());
        Intent intent = new Intent(activity, LoginActivity.class);
        intent.putExtra("userName", name);
        activity.startActivity(intent);
        activity.finish();
    }
}